using KinonekoSoftware.CodariaDB.Documents.Templates;
using KinonekoSoftware.Foundation.UI.Controls.Buttons;
using Microsoft.Xaml.Behaviors;

namespace KinonekoSoftware.Studio.Resources.Behaviors
{
    [Obsolete]
    public class LoadDataPartIconBehavior : Behavior<StateButton>
    {

        protected override void OnAttached()
        {

            if (AssociatedObject?.DataContext is DataPartTypeSelector vm)
            {
                if (string.IsNullOrEmpty(vm.Icon))
                {
                    return;
                }

                AssociatedObject.Icon = AssociatedObject.FindResource(vm.Icon) as Geometry;
            }
            base.OnAttached();
        }
    }
}